#pragma once

#include <vector>
#include <string>
#include "../SGD Wrappers/SGD_Declarations.h"
#include "../SGD Wrappers/SGD_Geometry.h"
#include "../SGD Wrappers/SGD_Handle.h"

class IGameState;

struct MenuButton
{
	std::string eventID = "";
	std::string data = "";
	SGD::Point position;
	SGD::Point parentPos;
	SGD::Size size;
	SGD::Point dataPos;
	SGD::HTexture image = SGD::INVALID_HANDLE;

	//Accessors
	const std::string& GetEventID() const { return eventID; }
	const std::string& GetData() const { return data; }
	const SGD::Point& GetPosition() const { return position; }
	const SGD::Size& GetSize() const { return size; }
	const SGD::Point& GetDataPos() const { return dataPos; }

	//Mutators
	void SetEventID(std::string id) { eventID = id; }
	void SetData(std::string d) { data = d; }
	void SetPosition(SGD::Point p) { position = p; }
	void SetSize(SGD::Size s) { size = s; }
	void SetDataPos(SGD::Point dp){ dataPos = dp; }

	//Interface
	void Update(float elapsedTime);
	void Render();
	const SGD::Rectangle GetRect();
	void Terminate();

	MenuButton(SGD::Point parentPos);
};


struct MenuItem
{
	std::string itemName = "";
	SGD::Point position;
	std::vector<MenuButton> buttons;

	//Accessors
	const std::string& GetItemName() const { return itemName; }
	const SGD::Point& GetPosition() const { return position; }

	//Mutators
	void SetItemName(std::string name) { itemName = name; }
	void SetPosition(SGD::Point pos) { position = pos; }

	//Interface
	void Update(float elapsedTime);
	void Render();
	void Terminate();
};

class Menu
{
public:
	Menu() = default;
	~Menu() = default;

	//Accessors
	const std::string& GetMenuName() const { return menuName; }

	//Mutators
	void SetMenuName(std::string name) { menuName = name; }

	//init
	void Initialize(std::string file);

	//Interface
	void Update(float elapsedTime);
	void Render();
	void Terminate();
	std::vector<MenuItem> menuItems;

private:
	std::string menuName = "";
};